/**
 * @author: yyq
 * @date: 2025年3月14日 13:57:27
 * @description: 
 */
package com.sheepone.monitor.enums;

/**
 * @author: yyq
 * @date: 2025年3月14日 13:57:27
 * @description:
 */
public enum MonitorRunnerStatusEnum {
    DEACTIVATE(0),
    INIT(1),
    STARTING(2),
    RUNNING(3),
    STOPPING(4),
    SHUTDOWN(5),
    ;

    private int status;

    public int getStatus() {
        return status;
    }

    private MonitorRunnerStatusEnum(int status) {
        this.status = status;
    }

    public static MonitorRunnerStatusEnum convert(int status) {
        for (MonitorRunnerStatusEnum value : MonitorRunnerStatusEnum.values()) {
            if (value.getStatus() == status) {
                return value;
            }
        }
        return null;
    }

    public static boolean check(int status) {
        for (MonitorRunnerStatusEnum value : MonitorRunnerStatusEnum.values()) {
            if (value.getStatus() == status) {
                return true;
            }
        }
        return false;
    }

    public static boolean le(int status, MonitorRunnerStatusEnum value) {
        return status <= value.getStatus();
    }

    public boolean ge(MonitorRunnerStatusEnum value) {
        return status >= value.getStatus();
    }

    public static boolean ge(int status, MonitorRunnerStatusEnum value) {
        return status >= value.getStatus();
    }
}
